#include "MyContextMenu.h"
//#include "Control_Pref.h"


DbContextMenu::DbContextMenu(){

}

/*DbContextMenu::DbContextMenu(MYSQL* mysql,wxTreeCtrl* treeview,wxTreeItemId cur){
    Append(wxID_ANY, wxT("&Delete"));
    Append(wxID_ANY, wxT("&Refresh"));
    Append(wxID_ANY, wxT("&Property"));	
}*/

DbContextMenu::DbContextMenu(wxTreeCtrl* treeview,wxTreeItemId cur){
    int id = treeview->GetItemImage(cur);
	if ( id == db ){
	    Append(DB_DEL, wxT("&Delete"));
		Append(DB_REFRESH, wxT("&Refresh"));
		Append(DB_PROPERTY, wxT("&Property"));	
	}
	else if ( id == table ){
	    Append(TABLE_PREVIEW, wxT("Preview"));
		Append(TABLE_SHOW_CREATE, wxT("Show create table"));
		Append(TABLE_SHOW_DESC, wxT("Show table structure"));	
		Append(TABLE_SHOW_INDEX, wxT("Show table index"));	
		Append(TABLE_PROPERTY, wxT("Property"));	
	}
	else if ( id == server ){
		Append(SERVER_REFRESH, wxT("Refresh"));	
	    Append(SERVER_RECONNECT,wxT("Reconnect"));
		//Append(SERVER_NEW_CONNECT, wxT("New Connection"));
		Append(SERVER_CLOSE, wxT("Close Connection"));	
	}
}

DbContextMenu::~DbContextMenu(){

}

